using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using InfoExpress.ESM.Domains;

namespace InfoExpress.ESM.WinApp.Popups
{
  public partial class FormEditShift : Form
  {
    private Shift _shift = null;

    public FormEditShift()
    {
      InitializeComponent();
    }

    public FormEditShift(Shift shift)
      : this()
    {
      _shift = shift;
      ucPeriodGroup.Shift = shift;
    }

    private void btnSave_Click(object sender, EventArgs e)
    {
      ucPeriodGroup.Save();
    }

    private void btnClear_Click(object sender, EventArgs e)
    {
      ucPeriodGroup.Clear();
    }

    private void FormEditShift_Load(object sender, EventArgs e)
    {
      #region Permission

      #region Permission
      btnClear.Enabled = true;
      btnSave.Enabled = true;
      ucPeriodGroup.ReadOnly = false;
      if (GlobalCache.CurrentUser.UserLevelId == 2)
      {
        btnClear.Enabled = false;
        btnSave.Enabled = false;
        ucPeriodGroup.ReadOnly = true;
      }
      #endregion

      #endregion
    }
  }
}